fix: Security hardening and PESAgent result handling#40
Conversation
- Fixed critical issue where execution loops terminating without explicit content (e.g., max iterations) failed to populate `item.result`. - Implemented smart fallback to the *last* tool result if LLM content is missing or empty. - Updated `completedItemsContext` and synthesis prompts to use tool result fallbacks, preventing 'undefined' context. - Fixed HITL resumption bug where state wasn't reset, causing the loop to skip the resumed item. - Ensured A2A task results are captured in `allToolResults` for proper fallback handling. - Added comprehensive regression test `test/pes-agent-result.test.ts` covering result population, max loop fallback, A2A integration, and full state resumption flow. - Bumped version to 0.4.7.
- Updated core version in src/index.ts and package files. - Regenerated API and site documentation in docs/components. - Fixed TypeScript comparison error in PES Agent execution loop. - Updated marketing site release notes and hero section. - Synchronized typedoc configurations to use consistent docs/ path.
…dd prompt leakage guardrails
Summary of ChangesHello @hashangit, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the stability and security of the ART framework. It resolves critical issues related to how the PESAgent handles tool call results and state persistence, ensuring more reliable agent execution. Concurrently, it introduces significant security measures to safeguard against prompt injection and system prompt leakage, bolstering the overall robustness of the system. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces important security hardening measures and fixes for the PESAgent's result handling, as described. The provided changes focus on updating documentation, the changelog, and version numbers. My review of these files suggests adding the security enhancements to the changelog to ensure it is a complete record of the changes in this version.
| ## [0.4.7] - 2025-12-27 | ||
|
|
||
| ### 🛠️ Stability & Robustness (PES Agent) |
There was a problem hiding this comment.
The changelog is missing the security hardening changes mentioned in the pull request description. It would be beneficial to add a "Security" section to this changelog entry to document the input sanitization and system prompt guardrail improvements. This ensures the changelog is a complete record of all significant changes in this version.
For example:
### 🔒 Security
- **Prompt Injection Prevention**: Implemented input sanitization for JSON markers to guard against prompt injection attacks.
- **System Prompt Protection**: Added guardrails to the synthesis system prompt to prevent leakage of sensitive instructions.
Fixes #39 and addresses security vulnerabilities.
Changes